{template 'common/header'}
<script type="text/javascript " src="../addons/lxy_buildpro/template/js/jquery.json-2.4.min.js"></script>
<div class="main">
<ul class="nav nav-tabs">
  <li{if $_GPC['do'] == 'buildlists'} class="active"{/if}><a href="{php echo $this->createWeburl('buildlists');}">楼盘管理</a>
  </li>
  <li{if $_GPC['do'] == 'albumlist'} class="active"{/if}><a href="{php echo $this->createWeburl('albumlist',array('hid'=>$hid));}">相册管理</a>
  </li>
  <li{if $_GPC['do'] == 'albumadd'} class="active"{/if}><a href="{php echo $this->createWeburl('albumadd', array('hid'=>$hid,'id'=>$id));}">添加相册</a>
  </li>
</ul>
<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data" name="hxform" id="hxform">
<input type="hidden" name="id" value="{$item['id']}">
<input type="hidden" name="hid" value="{$hid}">
<div class="panel panel-default">
<div class="panel-heading"> 楼盘相册信息 </div>
<div class="panel-body">
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">相册主名称</label>
  <div class="col-xs-12 col-sm-9">
    <input type="text" class="form-control" placeholder="" name="title" value="{$item['title']}" />
  </div>
</div>
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">相册子名称</label>
  <div class="col-xs-12 col-sm-9">
    <input type="text" class="form-control" placeholder="" name="subtitle" value="{$item['subtitle']}" />
  </div>
</div>
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">显示顺序</label>
  <div class="col-xs-12 col-sm-9">
    <input type="text" class="form-control" placeholder="" name="sort" value="{$item['sort']}" />
  </div>
</div>
<div class="form-group">
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">相册介绍</label>
  <div class="col-sm-9">
    <textarea style="height:100px;" class="span7 richtext-clone" name="jianjie" cols="70" id="jianjie">{$item['jianjie']}</textarea>
  </div>
</div>
<div class="form-group">
  <style>
.item_input textarea {
width: 150px;
height: 20px;
margin-top: 0;
margin-top: 0\0;
_margin-top: -1px;
border: #d3d3d3 1px solid;
border-top: none;
display: block;
font: 12px/20px Arial, "SimSun";
overflow: hidden;
padding: 0 2px;
}
</style>
  <label class="col-xs-12 col-sm-3 col-md-2 control-label">相册图片</label>
  <input id="hxpiclist"  name="hxpiclist" type="hidden"  value="{$jsonpic}" />
  <div class="col-xs-12 col-sm-9"> {php echo $this->tpl_multi_image_withsize('pic',$arrPic)} <span class="help-block">*要求图片大小650*650，图片大小不超过300K</span> </div>
</div>
<div class="form-group col-sm-12">
  <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
  <input type="hidden" name="token" value="{$_W['token']}" />
</div>
<script>
		$(function(){		
			$('#hxform').submit(function(){
				var pics = [];
				$('#fileList').find('div').each(function(){
					var msg = {};
					var img = $(this).find('img');
					msg.src = img.attr('src');
					msg.txt = $.trim($(this).find('textarea').val());
					var w = img.width();
					var h = img.height();
					w = parseInt(450*w/h);
					msg.w = w;
					msg.h = 450;
					pics[pics.length] = msg;
				});
				$('#hxpiclist').val($.toJSON(pics));
			});
		});
	</script> 
{template 'common/footer'}